<?php
require('system-config.php');

$options = array('users_can_register', 'gzipcompression', 'siteurl', 'wp-content_file_path', 'fileupload_base_url', 'email_structure', 'email_structure_error_message', 'import_allowed');

if (!array_key_exists($_POST['option'], $options))
	header("Location: settings.php");

validateToken($_POST['token'], 'setoption.php', $_POST['option']);

$_POST['value'] = preg_replace('|[;#]|', '', $_POST['value']);//since this script handles all the data coming in from settings.php, this can't be much more comprehensive

update_option($_POST['option'], stripslashes($_POST['value']));

header("Location: settings.php");
?>